package com.riven.redisson.annotation;


import com.riven.redisson.concurrent.LockSubjectProvider;
import com.riven.redisson.concurrent.NoOpLockSubjectProvider;

import java.lang.annotation.*;

/**
 * redis分布式锁，防止并发执行
 *
 * @author riven
 * @since 2025-05-22
 */
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface DistributedLock {

    /**
     * 锁主体提供者
     */
    Class<? extends LockSubjectProvider> subjectProvider() default NoOpLockSubjectProvider.class;

    /**
     * @return 异常信息
     */
    String errorMsg() default "操作过于频繁，请稍后再试";

}
